import { reqSearchList } from "@/api"
const home = {
    state: {
        searchList:{}
    },
    mutations: {
        GETSEARCHLIST(state,data){
            state.searchList=data
        },
    },
    actions: {
        async getSearchList(context,params){
            let res=await reqSearchList(params)
            if(res.code===200)context.commit('GETSEARCHLIST',res.data)
        }
    },
    getters: {
        goodsList(state){
            return state.searchList.goodsList||[]
        },
        attrsList(state){
            return state.searchList.attrsList
        },
        trademarkList(state){
            return state.searchList.trademarkList
        },
        total(state){
            return state.searchList.total
        }
    }
}
export default home